<!--
 * @Author: 刘美红 liumeihong@llootong.com
 * @Date: 2025-04-07 09:55:59
 * @LastEditors: 刘美红 liumeihong@llootong.com
 * @LastEditTime: 2025-06-03 17:00:43
 * @FilePath: \gzt-template\src\pages\eventdetail\cz.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
  <div class="zp-content">
    <div class="header-zp">事件处置</div>
    <p class="line"></p>
    <div class="cz-box">
      <cz ref="czref"></cz>
    </div>
    <div class="confirm-btn" @click="save">确认完成</div>
  </div>
</template>
<script setup>
import cz from "@/components/event/cz.vue";
import { completeEvent } from "@/api/event";
import { TabbarList } from "@/pinia/tabbar.js";
import { useRouter, useRoute } from "vue-router";
let piniaTab = TabbarList();
const route = useRoute();
const router = useRouter();
let czref = ref();

const props = defineProps({
  eventInfo: Object,
});
const save = async () => {
  try {
    let info = czref.value.getValue();
    let { data } = await completeEvent({
      ...info,
      busizEventId: props.eventInfo.busizEventId,
    });
    console.log("route.path,", route.path);
    piniaTab.deleted({
      path: route.path,
    });
    // router.push("/czlist");
    piniaTab.add({
      name: "处置列表",
      path: "/eventhandling",
      icon: "",
      query: {},
      meta: {
        hidden: false,
        title: "",
      },
    });
  } catch (e) {
    // 事件处置确认后执行的操作
    console.error("确认完成");
  }
};
</script>
<style lang="scss" scoped>
.zp-content {
  width: 100%;
  height: 100%;
  padding: 36px 25px 0 35px;
  .header-zp {
    font-family: PingFangSC, PingFang SC;
    font-weight: 500;
    font-size: 16px;
    color: #333333;
    line-height: 22px;
  }
  .line {
    width: 100%;
    height: 1px;
    margin: 18px 0;
    background: rgba(34, 99, 191, 0.2);
  }
  .confirm-btn {
    margin-left: 96px;
    width: 143px;
    height: 36px;
    background: #2263bf;
    border-radius: 4px;
    font-size: 12px;
    color: #ffffff;
    line-height: 36px;
    cursor: pointer;
    text-align: center;
  }
  .cz-box {
    height: calc(100% - 250px);
  }
}
</style>
